/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.ui;

import java.awt.Component;

import javax.swing.JScrollPane;

/**
 * 滚动条.
 * 
 * @version 2014年2月20日下午2:30:21
 * @author jrwz
 */
public class L1ScrollPane extends JScrollPane {
    private static final long serialVersionUID = 7847716138058741338L;
    /** 组件的x坐标. */
    protected int _x;
    /** 组件的y坐标. */
    protected int _y;
    /** 组件的宽度. */
    protected int _width;
    /** 组件的高度. */
    protected int _height;

    protected L1ScrollPane() {
    }

    protected L1ScrollPane(Component view) {
        super(view);
    }

    /**
     * 初始化.
     * 如要添加其他组件,应在此方法之前.
     * 
     * @param flag
     *            - 是否立即显示
     */
    protected void init(boolean flag) {
        setBounds(_x - 1, _y - 1, _width + 3, _height + 3);
        setOpaque(false); // 透明
        getViewport().setOpaque(false); // 透明
        setVisible(flag);
    }
}
